import json
import pandas as pd

from flask import Flask, render_template

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/article')
def article():
    return render_template(
        'article.html',
        title='咏鹅',
        content='鹅鹅鹅 曲项向天歌 白毛浮绿水 红掌拨清波'
    )


@app.route('/my')
def my_ape():
    return {
        'a': 1,
        'b': True,
        'c': None,
        'd': ['x', 'y'],
        'e': (5, 6),
        'df': pd.DataFrame([
            [1, 2],
            [3, 4],
        ]).values.tolist(),
        'h': {'i': 100, "j": [1, 2]},
        'g': [[8, 9], [3, 4]]
    }


if __name__ == '__main__':
    app.run()
